<?php
/**
 * Created by PhpStorm.
 * User: Lee
 * Date: 2019/12/19
 * Time: 16:12
 */
namespace App\Http\Request\System\Dic;

use App\Common\Utils\BaseRequest;

class AdditemRequest extends BaseRequest {
    public function rules() {
        $rules = [
            'diccode' => 'required|max:30',
            'itemcode' => 'required|max:15',
            'itemname' => 'required|max:30',
            'sortnum' => 'required|integer|min:1',
        ];

        return $rules;
    }

    public function messages() {
        $messages = [
            'diccode.required' => '字典编码不能为空',
            'diccode.max' => '字典编码长度不能超过30',
            'itemcode.required' => '编码不能为空',
            'itemcode.max' => '编码长度不能超过15',
            'itemname.required' => '名称不能为空',
            'itemname.max' => '名称长度不能超过30',
            'sortnum.required' => '排序不能为空',
            'sortnum.integer' => '排序为整数',
            'sortnum.min' => '排序必须大于0',
        ];

        return $messages;
    }
}